<jsp:directive.page contentType="text/html;charset=utf-8" />
<%@ include file="/taglibs.jsp" %>

<head>
	<title>Category Details</title>
</head>
<body>
	<div class="page-header">
	  <h3>
	  	View Category
	  </h3>

	</div>

	<form id="newCategoryForm" action="category!edit.action" validate="true" class="form-horizontal" autocomplete="off" method="POST">
		<s:hidden name="category.id"/>
		<fieldset >
			<div class="control-group">
				<label class="control-label" for="categoryId">
					<s:text name="module.common.id"/>:</label>
				<div class="control-value" >
					<s:property value="category.id"/>
					<s:hidden  id="parentCategoryId" label="" name="category.parentCategory.id"/>
				</div>	
			</div>
			<div class="control-group">
				<label class="control-label" for="categoryName">
					<s:text name="module.common.name"/>:</label>
				<div class="control-value">
					<s:property value="category.name" />
				</div>
			</div>
			<div class="control-group">
				<label class="control-label" for="categoryNameEn">
					<s:text name="module.common.nameEn"/>:</label>
				<div class="control-value">
					<s:property value="category.nameEn" />
				</div>
			</div>
			<div class="control-group">
				<label class="control-label" for="categoryId">
					<s:text name="module.common.description"/>:</label>
				<div class="control-value">
					<s:property value="category.description"/>
				</div>
			</div>
		</fieldset>
		<div class="control-group">
			<div class="controls">
			<button id="edit" class="btn btn-primary" type="button"><s:text name="button.edit"/></button>
			<button id="duplicate" class="btn" type="button"><s:text name="button.duplicate"/></button>
			<button id="delete" class="btn btn-warn" type="button"><s:text name="button.delete"/></button>
			</div>
			<em class="pull-right">Last updated by <s:property value="category.lastModifiedByUserLogin"/> at 
	  			<s:property value="category.lastModifiedDate"/></em>
		</div>
	</form>
	<script type="text/javascript">
		$(function() {
			$("#edit").click(function(){window.location='${ctx}/setup/category!edit.action?category.id=<s:text name="category.id"/>';});
			$("#duplicate").click(function(){window.location='${ctx}/setup/category!duplicate.action?category.id=<s:text name="category.id"/>';});
			$("#delete").click(function(){
				if(confirm("<s:text name='message.areYouSure'/>"))
					window.location='${ctx}/setup/category!delete.action?jq.id=<s:property value="category.id"/>';});
		});
	</script>
</body>
